import 'package:json_annotation/json_annotation.dart';

part 'user.g.dart';

@JsonSerializable()
class User {
  final int id;
  final String name;
  final String email;

  // 添加更多字段以匹配测试API
  final String? username;
  final String? phone;
  final String? website;

  User({
    required this.id,
    required this.name,
    required this.email,
    this.username,
    this.phone,
    this.website,
  });

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
  Map<String, dynamic> toJson() => _$UserToJson(this);
}